<?php
/**
 * SocialEngine
 *
 * @category   Application_Core
 * @package    User
 * @copyright  Copyright 2006-2010 Webligo Developments
 * @license    http://www.socialengine.net/license/
 * @version    $Id: Controller.php 9264 2011-09-16 19:18:51Z john $
 * @author     John
 */

/**
 * @category   Application_Core
 * @package    User
 * @copyright  Copyright 2006-2010 Webligo Developments
 * @license    http://www.socialengine.net/license/
 */
class Visits_Widget_VisitsController extends Engine_Content_Widget_Abstract
{
  public function indexAction()
  {

  $subject = Engine_Api::_()->core()->getSubject();
  $viewer = Engine_Api::_()->user()->getViewer();
  
  // Add visit
  if( !$subject->isSelf($viewer) && $viewer->getIdentity()) {
  Engine_Api::_()->getDbtable('visits', 'visits')->addVisit($subject);
  }
  
  return $this->setNoRender();
  
  }
}